import request from '@/utils/request'


export function getPage(params) {
  return request({
    url: 'admin/dict/list',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'admin/dict/save',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'admin/dict/del',
    method: 'post',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'admin/dict/save',
    method: 'post',
    data
  })
}

export function getByCode(code) {
  return request({
    url: 'admin/dict/getByCode?code=' + code,
    method: 'get'
  })
}

export default {add, edit, del, getByCode,getPage}
